package Crawler_data;

import java.io.IOException;
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.junit.Test;

import each_class.Album;
import each_class.RanKingClass;
import each_class.SongClass;

public class Ctest {
	Crawler_data Crawler_data = new Crawler_data();

	@Test
	public void test1() {
		List<SongClass> songList = Crawler_data.grabble("海底", 0);
		for (SongClass s : songList) {
		//	System.out.println(s);
		}
		System.out.println(Crawler_data.gravble_lyric(songList.get(0)));
		;
	}

	@Test
	public void test9() {
		
	}
	
	@Test
	public void test2() {
		List<SongClass> songList = Crawler_data.grabble("海底", 0);

		Crawler_data.gravble_image( songList.get(0));
		System.out.println(songList.get(0).toString());
	}

	@Test
	public void test3() {
		List<SongClass> songList = Crawler_data.grabble("海底", 0);

		Map<String, String> map = Crawler_data.gravble_lyric(songList.get(0));

		Set<Map.Entry<String, String>> entries = map.entrySet();
		for (Map.Entry<String, String> entry : entries) {
			System.out.println(entry.getKey() + "===" + entry.getValue());
		}
	}

	@Test
	public void test4() {
		List<SongClass> songList = Crawler_data.grabble("海底", 0);
		Crawler_data.gravble_image( songList.get(0));
		try {
	//		Crawler_data.Get_image(songList.get(0).getSong_image_url());
			// Get_music("http://music.163.com/song/media/outer/url?id=" +
			// songList.get(0).getSong_id());

		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	@Test
	public void test5() {
//		List<SongClass> songList = Crawler_data.grabble("海底", 0);
//		Crawler_data.Get_album(songList.get(0).getAlbum_id(), songList.get(0).getAlbum_name());

		Album alnum = Crawler_data.Get_album("86447217", "海底");
		System.out.println(alnum.toString());
	}

	@Test
	public void test6() {

		Crawler_data.Get_Singers_album("10204", null);

		System.out.println(Crawler_data.Get_Singers_album("10204", null).toString());

	}

	@Test
	public void test7() {

		RanKingClass ranKingClass = Crawler_data.ranKing(null);
		List<SongClass> songList = ranKingClass.getSongList();

		for (SongClass s : songList) {
			System.out.println(s);
		}

		System.out.println(ranKingClass);
	}
}
